﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Backend.JYD.Cache;
using Backend.JYD.Model;

namespace Backend.JYD.Business
{
    public class EmpManager
    {
        private const string Key_EmpInfo = "key_EmpInfo_";

        private static readonly IDAL.IEmpInfo empDAL = Factory.DALFactory.CreateEFDAL<IDAL.IEmpInfo>("DAL.EmpInfoDAL");

        #region EmpInfo

        private static List<EmpInfo> LoadAllEmpInfo()
        {
            var list = CacheMgr.Instance.GetCachedItem<List<EmpInfo>>(Key_EmpInfo);
            if (list == null)
            {
                var temp = empDAL.GetAllEmpInfo();
                if (temp != null)
                {
                    CacheMgr.Instance.SetCachedItem<List<EmpInfo>>(Key_EmpInfo, temp.ToList());
                }
            }
            return list;
        }


        #endregion

    }
}
